<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="lib/vue.global.js"></script>
</head>
<body>
  <div id="root">
    <ul>
      <li v-for="item of list" :key="item" v-if="true">
        {{ item }}
      </li>
    </ul>
    <div>{{ obj }}</div>
  </div>
</body>
<script>
  const { createApp } = window.Vue

  const app = createApp({
    data () {
      return {
        list: ['a', 'b', 'c', 'd'],
        obj: {
          x: 1
        }
      }
    },
    mounted () {
       setTimeout(() => {
        this.obj.x = 2
        this.obj.y = 20 
       }, 3000)
    }
  })
  const vm = app.mount('#root')
  // vm.list[0] = 'aaa'
  // vm.list.length = 0
  console.log(vm)
  // vue3 可以通过数组下标改变数组数据，也可以通过设置数组长度为0来清空数组
</script>
</html>